function MaxNumberCount(arr) {
    let left = 0, right = 0;
    // 1. 排序
    arr.sort((a, b) => a - b)
    // [1,1,2,2,2,3,3,3,4]
    let count = 0
    let ans = []
    // 2. 双指针求最大值
    while (right < arr.length) {
        if (arr[left] == arr[right]) {
            right++
        } else {
            left = right
        }
        if (count <= right - left) {
            count = right - left
            ans.push([arr[left], count])
        }
    }
    ans = ans.filter(item => item[1] == count)
    return ans
}
console.log(MaxNumberCount([2, 4, 3, 7, 8, 10, 3, 3, 3, 20, 2, 2, 2, 1, 1]));